var commentViews = {

	show : function(idIdea){
		var winWellcome = Titanium.UI.createWindow({
			backgroundColor:'#111',
			opacity:0.8,
			barcolor:'#333',
			title:L("Afegir comentari"),
			modal: true
		});

		var buttonOk = Ti.UI.createButton({
			font:{size:"8"},
			bottom:10,
			height:40,
			width:80,
			left:20,
			title:L('Enviar')
		});
		
		var buttonGo = Ti.UI.createButton({
			font:{size:"8"},
			right:20,
			bottom:10,
			height:40,
			width:140,
			title:L('Cancelar')
		});
		buttonGo.addEventListener('click',function(){
			winWellcome.close();
		});
		
		var text2 = Ti.UI.createTextArea({
			font:{fontSize:"14"},
			top:5,
			height:190,
			left:5,
			right:5,
			borderRadius:5.0,
			autocorrect:false,
			autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_SENTENCES,
			borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
			suppressReturn:false
			
			//text:L('infoTorrent')
		});
		
		Ti.App.addEventListener('addCommentOk',function(){
			winWellcome.close();
		});
		
		Ti.App.addEventListener('addCommentKo',function(){
			Ti.App.network_user.showAlert(L('WARNING'),L("No s'ha pogut enviar el comentari"));
			winWellcome.close();
		});
		
		buttonOk.addEventListener('click',function(){
			if(text2.value != "" && text2.value != null){
				Ti.App.network_user.addComment(idIdea,text2.value);
			}else{
				Ti.App.network_user.showAlert(L('WARNING'),L("Has de escriure quelcom si vols comentar."));
			}
		});
		
		
		winWellcome.add(text2);
		winWellcome.leftNavButton = buttonOk;
		winWellcome.rightNavButton = buttonGo;
		winWellcome.addEventListener("open", function(event, type) {
			text2.focus();
		});
		 
		winWellcome.open({
		    modal:true,
		    presentation:Ti.UI.iPhone.MODAL_PRESENTATION_FULLSCREEN,
		    modalTransitionStyle:Ti.UI.iPhone.MODAL_TRANSITION_STYLE_COVER_VERTICAL
		});
	}
	
};